package com.suray.system.run.seer.type;

import com.suray.basic.wcs.utils.IBaseEnum;

import java.io.Serializable;

public enum PointMapType implements IBaseEnum<Serializable> {
    DEFAULT_TYPE(0, "默认点位"),
    PLC_TYPE(1, "plc点位"),
    CONNECT_TYPE(2, "接驳点"),
    LIFT_TYPE(3, "提升机点"),
    FORBIDDEN_TYPE(100, "禁用点位"),
    ;

    int value;
    String des;
    PointMapType(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public static PointMapType parseType(int type) {
        for (PointMapType pointMapType : PointMapType.values()) {
            if (pointMapType.value == type) {
                return pointMapType;
            }
        }

        throw new RuntimeException("错误的点位类型:" + type);
    }

    public Integer getValue() {
        return value;
    }

    @Override
    public String toString() {
        return des;
    }

    @Override
    public String getDescription() {
        return des;
    }

    @Override
    public Serializable getVal() {
        return value;
    }
}
